<?php

/**
 * This is the model class for table "horizontal_exit".
 *
 * The followings are the available columns in table 'horizontal_exit':
 * @property integer $id
 * @property string $width_of_door
 * @property string $units_of_measurement_of_the_door
 * @property string $door_construction
 * @property integer $with_vision_panel
 * @property integer $door_swing_in_the_direction_of_egress_travel
 * @property integer $with_self_closing_device
 * @property string $width_of_corridor_and_hallway
 * @property string $units_of_measurement_of_the_width_corridor_and_hallway
 * @property string $coh_construction
 * @property integer $corridor_wall_extended_from_slab_to_slab
 * @property integer $properly_illuminated
 * @property integer $exit_readily_visible
 * @property integer $clear_and_unobstructed
 * @property integer $properly_marked_with_illuminated_exit_sign
 * @property integer $with_illuminated_directional_sign
 * @property integer $properly_located
 * @property integer $exit_detail_id
 *
 * The followings are the available model relations:
 * @property ExitDetail $exitDetail
 */
class HorizontalExit extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return HorizontalExit the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'horizontal_exit';
	}
const a = "Foot";
const b ="Inches";
public function getMeasurement(){
return array(
self::a=>"Foot",
self::b=>"Inches"
);


}
const c = "Foot";
const d ="Inches";
public function getMeasurementa(){
return array(
self::c=>"Foot",
self::d=>"Inches"
);


}
	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('exit_detail_id', 'required'),
			array('with_vision_panel, door_swing_in_the_direction_of_egress_travel, with_self_closing_device, corridor_wall_extended_from_slab_to_slab, properly_illuminated, exit_readily_visible, clear_and_unobstructed, properly_marked_with_illuminated_exit_sign, with_illuminated_directional_sign, properly_located, exit_detail_id', 'numerical', 'integerOnly'=>true),
			array('width_of_door, width_of_corridor_and_hallway', 'length', 'max'=>11),
			array('units_of_measurement_of_the_door, units_of_measurement_of_the_width_corridor_and_hallway', 'length', 'max'=>6),
			array('door_construction, coh_construction', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, width_of_door, units_of_measurement_of_the_door, door_construction, with_vision_panel, door_swing_in_the_direction_of_egress_travel, with_self_closing_device, width_of_corridor_and_hallway, units_of_measurement_of_the_width_corridor_and_hallway, coh_construction, corridor_wall_extended_from_slab_to_slab, properly_illuminated, exit_readily_visible, clear_and_unobstructed, properly_marked_with_illuminated_exit_sign, with_illuminated_directional_sign, properly_located, exit_detail_id', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'exitDetail' => array(self::BELONGS_TO, 'ExitDetail', 'exit_detail_id'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'width_of_door' => 'Width Of Door',
			'units_of_measurement_of_the_door' => 'Units Of Measurement Of The Door',
			'door_construction' => 'Door Construction',
			'with_vision_panel' => 'With Vision Panel',
			'door_swing_in_the_direction_of_egress_travel' => 'Door Swing In The Direction Of Egress Travel',
			'with_self_closing_device' => 'With Self Closing Device',
			'width_of_corridor_and_hallway' => 'Width Of Corridor And Hallway',
			'units_of_measurement_of_the_width_corridor_and_hallway' => 'Units Of Measurement Of The Width Corridor And Hallway',
			'coh_construction' => 'Coh Construction',
			'corridor_wall_extended_from_slab_to_slab' => 'Corridor Wall Extended From Slab To Slab',
			'properly_illuminated' => 'Properly Illuminated',
			'exit_readily_visible' => 'Exit Readily Visible',
			'clear_and_unobstructed' => 'Clear And Unobstructed',
			'properly_marked_with_illuminated_exit_sign' => 'Properly Marked With Illuminated Exit Sign',
			'with_illuminated_directional_sign' => 'With Illuminated Directional Sign',
			'properly_located' => 'Properly Located',
			'exit_detail_id' => 'Exit Detail',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('width_of_door',$this->width_of_door,true);
		$criteria->compare('units_of_measurement_of_the_door',$this->units_of_measurement_of_the_door,true);
		$criteria->compare('door_construction',$this->door_construction,true);
		$criteria->compare('with_vision_panel',$this->with_vision_panel);
		$criteria->compare('door_swing_in_the_direction_of_egress_travel',$this->door_swing_in_the_direction_of_egress_travel);
		$criteria->compare('with_self_closing_device',$this->with_self_closing_device);
		$criteria->compare('width_of_corridor_and_hallway',$this->width_of_corridor_and_hallway,true);
		$criteria->compare('units_of_measurement_of_the_width_corridor_and_hallway',$this->units_of_measurement_of_the_width_corridor_and_hallway,true);
		$criteria->compare('coh_construction',$this->coh_construction,true);
		$criteria->compare('corridor_wall_extended_from_slab_to_slab',$this->corridor_wall_extended_from_slab_to_slab);
		$criteria->compare('properly_illuminated',$this->properly_illuminated);
		$criteria->compare('exit_readily_visible',$this->exit_readily_visible);
		$criteria->compare('clear_and_unobstructed',$this->clear_and_unobstructed);
		$criteria->compare('properly_marked_with_illuminated_exit_sign',$this->properly_marked_with_illuminated_exit_sign);
		$criteria->compare('with_illuminated_directional_sign',$this->with_illuminated_directional_sign);
		$criteria->compare('properly_located',$this->properly_located);
		$criteria->compare('exit_detail_id',$this->exit_detail_id);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}